package com.github.live.player;

import android.content.Context;

import com.github.live.util.LogFactory;
import com.github.livebase.player.IMediaPlayer;
import com.github.livebase.player.IMediaPlayerFactory;

/**
 * @ClassName IJKPlayerFactory
 * @description:
 * @author: biao532
 * @create: 2023-12-19 14:49
 * @Version 1.0
 **/
public class MultiPlayerFactory implements IMediaPlayerFactory<MultiFactoryPlayer> {
    private int max;
    private IMediaPlayerFactory<? extends IMediaPlayer> factory;

    public MultiPlayerFactory(int max, IMediaPlayerFactory<? extends IMediaPlayer> factory) {
        this.max = max;
        this.factory = factory;
    }

    @Override
    public MultiFactoryPlayer create(Context context) {
        LogFactory.debug(MultiPlayerFactory.class, "crete new player");
        return new MultiFactoryPlayer(context, factory, max);
    }

    @Override
    public String getName() {
        return "ijkM";
    }
}
